using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyController : BattleBase
{
    [Range(0,360)]
    [SerializeField] protected float viewAngle = 120.0f;
    [SerializeField] protected int viewDistance = 20;
    // ��޶�����ֻ�����һ�������������Ǽ����յл���ʱҪ��չΪ����б�
    protected GameObject hates;
    // Start is called before the first frame update
    void Start()
    {
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    protected void FaceToTarget(GameObject gameObject)
    {
        Vector3 direction = hates.transform.position - bulletPoint.transform.position;
        direction.z = unit.transform.position.z;
        direction = direction.normalized;
        unit.transform.up = direction;
    }

    public void OnDamaged(DamageResult damageResult)
    {
        // ����������Ϊ��޶���
        hates = damageResult.GetDamage.GetSource;
    }
}
